package com.richfit.barcodesystem_cczt.utils;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Urls {
    public static final String FROM = "android";
    /**
     * 请求头token
     */
    public static String AUTH = "Authorization";
    public static String Cookie = "Cookie";
    /**
     * POST,传递json 格式数据
     */
    public static String JSON_TYPE = "application/json; charset=utf-8";
    public static String FROM_TYPE = "application/x-www-form-urlencoded";
    public static String http = "http://";
    public static String https = "https://";
    public static final String URL = getHttp(0) + "11.11.136.202:10020";
//    public static final String URL = getHttp(0) + "10.88.54.33:10020";


    //网络超时时间 3秒
    public static int HTTP_TIME_OUT = 3000;
    /**
     * 测试网络是否连通
     */
    public static String URL_CONNECTIONSTATUS = "/comm/login/getConnectionStatus";
    /**
     * app更新
     */
    public static String URL_UPDATE = "/cczt/mobile/getAppVersion";
    /**
     * 登陆验证码
     */
    public static String URL_LOGIN_CODE = "/comm/login/captcha";
    /**
     * 登录
     */
    public static String URL_LOGIN = "/comm/login/dologin";
    /**
     * 用户信息
     */
    public static String URL_CURUSER = "/comm/login/curuser";
    /**
     * 库存地点数据
     */
    public static String URL_INCREMENTALINFO = "/cczt/mobile/getIncrementalInfo";

    /**
     * 获取装箱单信息
     */
    public static String URL_ZBOX = "/cczt/mobile/zbox";
    /**
     * 获取单个箱子的详细列表
     */
    public static String URL_ZBOX_DETAIL = "/cczt/mobile/zbox-detail";
    /**
     * 批量入库
     */
    public static String URL_ZBOX_BATCH_IN = "/cczt/mobile/zbox-batch-in";
    /**
     * 获取分箱单信息
     */
    public static String URL_FBOX = "/cczt/mobile/fbox";
    /**
     * 出库确认
     */
    public static String URL_FBOX_BATCH_SURE = "/cczt/mobile/fbox-batch-sure";
    /**
     * 批量出库
     */
    public static String URL_FBOX_BATCH_OUT = "/cczt/mobile/fbox-batch-out";
    /**
     * 调整分箱单的箱子到其他分箱单
     */
    public static String URL_FBOX_MOVE = "/cczt/mobile/fbox-move";
    /**
     * 获取单个箱子的信息查询
     */
    public static String URL_ZBOX_LINE = "/cczt/mobile/zbox-line";
    /**
     * 仓位调整
     */
    public static String URL_ZBOX_LOCATION = "/cczt/mobile/zbox-location";
    /**
     * 拆箱装箱
     */
    public static String URL_ZBOX_MOVE = "/cczt/mobile/zbox-move";
    /**
     * 物资条码信息查询
     */
    public static String URL_INVENTORIES = "/cczt/inventories";

    /**
     * 切换安全和非安全连接
     *
     * @param type
     * @return
     */
    public static String getHttp(int type) {
        return type == 0 ? http : https;
    }

    /**
     * 封装基本的提交参数
     */
    public static Map<String, String> getDefaultConfigrationMap() {
        Map<String, String> map = new ConcurrentHashMap<>();
        map.put("from", FROM);
        return map;
    }
}
